package main

import (
	"fmt"
	"service/components"
	"service/modules"
	"service/router"
)

func main() {
	components.InitConfig()
	components.InitRedis()
	components.DB = components.InitGorm()
	err := components.DB.AutoMigrate(
		&modules.Users{},
		&modules.File{},
		&modules.Menu{},
		&modules.Department{},
		&modules.Attribute{},
	)
	if err != nil {
		fmt.Println("创建表失败: ", err)
		return
	}
	router.InitRouter()
}
